package cn.hl.service.impl;

import cn.hl.domain.Product;
import cn.hl.mapper.ProductMapper;
import cn.hl.service.IProductService;
import cn.hl.util.CodeGenerateUtils;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author hulan
 * @since 2022-09-29
 */
@Service
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements IProductService {

    @Override
    public boolean insert(Product product) {
        product.setSn(CodeGenerateUtils.generateProductCode());
        return super.insert(product);
    }
}
